<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>网站的滚动效果</title>
  <link rel="stylesheet" href="index.css">
</head>
<body>
  <div class="layer">
    <img src="plane.png" class="plane">
  </div>
  <section></section>
  <div class="text">
    <h2>Welcome To<br/><span>TThailand</span></h2>
  </div>
  <section class="sec2"></section>
  <script>
    let layer = document.querySelector('.layer');
    window.addEventListener('scroll', function(){
      let value = window.scrollY;
      layer.style.left = value*2 +'px';
    })
  </script>
</body>
</html>